import React, { Component } from 'react';
import { Form, Input, Select,InputNumber,Row,Col } from 'antd';
import './modal.css';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';

class EditMbName extends Component {

  static propTypes = {     
    mb: PropTypes.object.isRequired,
    setForm: PropTypes.func.isRequired,  
  }
  

  state = {
    curveNameArray:['空'],    // 所有的曲线名 数组
    visible: false,
  }
  
  formRef = React.createRef();  // form对象

  componentDidMount() {  
    this.props.setForm(this.formRef);  // 调用父组件传递的函数，目的是将 参数以实参的形式传递给父组件   
  }

  render() {
    const mb_name = this.props.mb.mb_name;
    return (
      <div className="edit-curve-form">
        <Form 
          ref={this.formRef}     
          name="control-ref" 
          onFinish={this.onFinish}
          initialValues={{
            mb_name: mb_name,
          }}
        >   
          <Form.Item
            name="mb_name" 
            rules={[{ required: true, message: '模板名称不能为空！' }]}
          >
            <Input 
              placeholder="请输入模板名称"
            />
          </Form.Item>
        </Form>
      </div>  
    )
  }
}

export default connect(
  state => ({user: state.user ,docData: state.docData,}),
  {}
)(EditMbName);

